#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>

int main()

{

    int h, f;

    double x, y;

    while (1) {

        printf("heads,feet:");

        scanf("%d%d", &h, &f);

        if (h <= 0 || f <= 0) {

            printf("Bye!\n");

            return 0;
        }

        y = f / 2.0 - h;

        x = h - (int)y;

        if (x + y == h && x >= 0 && y >= 0) {

            printf("chickens=%.0f,rabbits=%.0f\n", x, y);
        }

        else {

            printf("no answers\n");
        }

        h = 0, f = 0, x = 0, y = 0;
    }

    return 0;

}